Skip to content

Use Random Port Selection to Bypass Locked Default VPN Port on Windows #267

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

JuenTingShie
Copy link

On Windows, the default VPN port (2222) somehow will been used by PID 4 (also known as System) randomly, that cannot be detected that is been using by command $(ss -tan4H "sport = $port").

When 2222 port is been using and not detected by ss, original strategy will keep using 2222 port, causing unable to start vpn.

This PR implements a change to use random port selection instead default VPN port, or PORT+=1

Note:
This update improves the handling of port conflicts, though further work may be needed to fully resolve situations where ports remain undetectable.

al-kuznetsov and others added 2 commits August 22, 2024 02:06
If the default SSH port 2222 is inaccessible
choose next available port.

Fixes issue sakai135#230
…egy.

This change prevents scenarios where a sequentially chosen port may be locked and fail to be detected by the `$ ss -tan4H` check.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants